package com.qingcheng.service.impl;

import com.qingcheng.service.business.AdService;
import com.qingcheng.service.goods.CategoryService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: LDeng
 * @Date: 2020-05-21 15:29
 */


//该类继承InitializingBean 接口 ， 随着工程启动的时候启动

@Component
public class Init implements InitializingBean{

    @Autowired
    private AdService adService;

    public void afterPropertiesSet() throws Exception {

        System.out.println("============》广告数据存入redis缓存《=============");
        adService.saveAllAdToRedis();

    }
}
